package vn.student.mylib;

import vn.student.R;

public class WeekDay {
	public static final String[] day = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
	public static final int[] num = {R.id.sun,R.id.mon,R.id.tue,R.id.wed,R.id.thu,R.id.fri,R.id.sat};
	static public int getDayId(String dayIn){
		for(int i=0;i<day.length;i++){
			if(dayIn.equals(day[i]))
				return num[i];
		}
		return -1;
	}
	public static int getDayId(int i) {
		return num[i];
	}
	public static String getDayName(int i) {
		return day[i];
	}
	public static int getWeekDay(String dayStr) {
		for(int i=0;i<day.length;i++){
			if(dayStr.equals(day[i]))
				return i;
		}
		return -1;
	}
	public static String getWeekDay(int dayInt) {
		return day[dayInt];
	}
	public static String getDayNameById(int id) {
		for(int i=0;i<day.length;i++){
			if(num[i] == id)
				return day[i];
		}
		return null;
	}
}
